/*
 * This file is part of Space Invaders: Rehash
 * Copyright (C)2007 Vicent Marti (tanoku@gmail.com)
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#ifndef	_GAME_PLAYER_H_
#define	_GAME_PLAYER_H_

#include "SDL.h"
#include <stdio.h>
#include <string>
#include <vector>

#include "game.h"
#include "timer.h"
#include "main.h"
#include "sprites.h"
#include "game_const.h"

class Game;
class Missile;
class Alien;

class Player
{
	int m_x;
	int m_y;
	
	double m_worldx;
	double m_worldy;
	
	int m_vel;
	
	int m_missileCount;
	Uint32 m_lastShoot;
	
	Game *m_parent;
	
	std::vector<Missile*> m_missiles;

	int m_health;

	SimpleTimer m_deathFXTimer;

public:
	Player( Game *parent );

	void render();
	void tick();

	void getBounds( SDL_Rect *r );
	void hit( int damage );

	bool isDead()
	{
		return ( m_health <= 0 );
	}

	int getHealth()
	{
		return m_health;
	}
};


#endif
